<?php

//gets URL argument
$input=strtolower($_GET['input']);

//gets assoc. array of locations
require_once('../sql/locations.php');

//if a match was found
if(isset($locations[$input]))
{
	$row=$locations[$input];
	
	//get name, x, y
	$name = $row['name'];
	$x = $row['x'];
	$y = $row['y'];
	
	//return name and x,y coordinates
	echo('{"name":"'.$name .'", "x":"'.$x.'", "y":"'.$y.'"}');
}
//no matches found
else
{
	echo "ERROR";
}

?>
